Invokes a transform function on each element of a view of elements of a generic type and computes the minimum resulting value.
Namespace:
C1.LiveLinqAssembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public static AggregationView<TSource, TResult> LiveMin<TSource, TResult>( this View<TSource> source, Expression<Func<TSource, TResult>> selector ) |
Visual Basic |
---|
<ExtensionAttribute> _ Public Shared Function LiveMin(Of TSource, TResult) ( _ source As View(Of TSource), _ selector As Expression(Of Func(Of TSource, TResult)) _ ) As AggregationView(Of TSource, TResult) |
Parameters
- source
- Type: C1.LiveLinq.LiveViews..::..View<(Of <(<'TSource>)>)>
A view containing the values to determine the minimum value of.
- selector
- Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'TSource, TResult>)>)>>)>)>
A transform function to apply to each element.
Type Parameters
- TSource
- The type of the elements of source.
- TResult
- The type of the value returned by selector.
Return Value
A view representing the minimum of the values.Remarks
If type TResult implements IComparable<(Of <(<'T>)>)>, this method uses that implementation to compare values. Otherwise, if type TResult implements IComparable, that implementation is used to compare values.
It is possible to use standard LINQ query operator Min instead of LiveMax. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Min will every time loop through the entire source collection and aggregate it from scratch, whereas LiveMax will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.